Skip to content

Conversation

@RobertJoonas
Copy link
Contributor

@RobertJoonas RobertJoonas commented Jan 29, 2025

Required migration steps

Migrating from the old unique index to the new one is a bit tricky, requiring multiple steps:

  1. Migration: Add scroll_threshold column to Goal and add the new unique index. Page Scroll Goals: migration step 1 #5033
  2. Minimal schema change: Make Ecto aware of the new unique_constraint. Page Scroll Goals: migration step 2 #5034
  3. Migration: Drop the old index. Page Scroll Goals: migration step 3 #5036

Once the old index is dropped, this PR is ready to go.

Changes

This PR implements page scroll goals.

A page scroll goal can be created by simply adding a value into an optional scroll_threshold field when creating a pageview goal:

image

A user can filter and break down page scroll goals like any other goals.

TODO: figure out what to do with the total conversions metric

Tests

  • Automated tests have been added

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@RobertJoonas RobertJoonas requested a review from macobo January 29, 2025 12:23
Copy link
Contributor

@macobo macobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial thoughts on the PR. Will dig into the query side of this in-depth in another pass.

@RobertJoonas RobertJoonas changed the title Page scroll goals Page Scroll Goals Jan 30, 2025
@macobo macobo force-pushed the page-scroll-goals branch 2 times, most recently from 9978623 to 3c63b79 Compare January 30, 2025 11:35
@macobo macobo force-pushed the page-scroll-goals branch from 3c63b79 to 7e2e780 Compare January 30, 2025 11:39
@macobo macobo force-pushed the page-scroll-goals branch from da3f88a to ebf0dfb Compare January 30, 2025 11:52
@RobertJoonas RobertJoonas requested a review from macobo February 3, 2025 13:23
end
end

describe "page scroll goals" do
Copy link
Contributor

@macobo macobo Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're still missing a test showing the behavior with imported data + conversion rate + goal group by.

@RobertJoonas
Copy link
Contributor Author

I think we're still missing a test showing the behavior with imported data + conversion rate + goal group by.

@macobo test/plausible_web/controllers/api/external_stats_controller/query_imported_test.exs:1468 is testing it. If you meant to say imported data + group conversion rate + goal group by - that's not possible with imported data, as mixing multiple dimensions will make the query ineligible for imported data.

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

Preview environment👷🏼‍♀️🏗️
PR-5029

Copy link
Contributor

@macobo macobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be happy if the testing nit were resolved but other than that looks great!

@RobertJoonas RobertJoonas added this pull request to the merge queue Feb 4, 2025
Merged via the queue into master with commit 4d05245 Feb 4, 2025
8 checks passed
@RobertJoonas RobertJoonas deleted the page-scroll-goals branch February 4, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants